/*
 * Copyright (C) 2016 Apple Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 */

.tree-outline,
.tree-outline .children {
    padding: 0;
    margin: 0;

    outline: none;

    list-style: none;
}

.tree-outline .children {
    display: none;
}

.tree-outline .children.expanded {
    display: block;
}

.tree-outline .item {
    height: 20px;

    padding: 0 5px;

    border-top: 1px solid transparent;

    white-space: nowrap;
}

.tree-outline.compact .item {
    height: inherit;
}

.tree-outline.large .item {
    height: 36px;
    line-height: 34px;
}

.tree-outline.hide-disclosure-buttons > .children {
    display: none;
}

.tree-outline > .children.hide-disclosure-buttons > .children {
    display: none;
}

.tree-outline:not(.hide-disclosure-buttons) .item:not(.parent) > .icon {
    margin-left: 16px;
}

.tree-outline .item .disclosure-button {
    display: none;

    float: left;

    width: 16px;
    height: 16px;

    border: 0;

    background-color: transparent;
    background-image: url(../Images/DisclosureTriangles.svg#closed-normal);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 13px 13px;

    -webkit-appearance: none;
}

.tree-outline.hide-disclosure-buttons .item .disclosure-button {
    display: none;
}

.tree-outline .item.parent .disclosure-button {
    display: block;
}

.tree-outline:matches(:focus, .force-focus) .item.selected .disclosure-button {
    background-image: url(../Images/DisclosureTriangles.svg#closed-selected) !important;
}

.tree-outline .item.expanded .disclosure-button {
    background-image: url(../Images/DisclosureTriangles.svg#open-normal);
}

.tree-outline:matches(:focus, .force-focus) .item.selected.expanded .disclosure-button {
    background-image: url(../Images/DisclosureTriangles.svg#open-selected) !important;
}

.tree-outline .item .icon {
    float: left;
    position: relative;

    width: 16px;
    height: 16px;

    margin-top: 1px;
    margin-right: 3px;
}

.tree-outline.compact .item .icon {
    margin-top: 0;
}

.tree-outline.large .item .icon {
    width: 32px;
    margin-right: 6px;
}

.tree-outline .item .status {
    float: right;

    margin-left: 4px;
    margin-top: 1px;

    line-height: 1em;
}

.tree-outline.large .item .status {
    margin-top: 9px;
}

.tree-outline .item .status:empty {
    display: none;
}

.tree-outline .item.selected {
    background-color: hsl(0, 0%, 83%);
}

.tree-outline:matches(:focus, .force-focus) .item.selected {
    color: white;
    background-color: hsl(209, 100%, 49%);
}

body.window-inactive .tree-outline .item.selected {
    background-color: hsl(0, 0%, 83%);
}

.tree-outline .item .titles {
    position: relative;
    top: 2px;

    line-height: normal;

    padding-bottom: 1px;

    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.tree-outline.compact .item .titles {
    top: 0;
}

.tree-outline.large .item .titles {
    top: 5px;
    line-height: 11px;
}

.tree-outline .item .highlighted {
    background-color: hsla(53, 83%, 53%, 0.2);
    border-bottom: 1px solid hsl(47, 82%, 60%);
}

.tree-outline.large .item .titles.no-subtitle {
    top: 10px;
}

.tree-outline .item .title::after {
    content: "\A"; /* Newline */
    white-space: pre;
}

.tree-outline .item .subtitle {
    font-size: inherit;
    color: hsla(0, 0%, 0%, 0.7);
}

.tree-outline.large .item .subtitle {
    font-size: 9px;
}

.tree-outline:matches(:focus, .force-focus) .item.selected .subtitle {
    color: hsla(0, 0%, 100%, 0.9);
}

.tree-outline .item .titles.no-subtitle .subtitle,
.tree-outline .item .subtitle:empty {
    display: none;
}

.tree-outline:not(.large) .item .status .indeterminate-progress-spinner {
    margin-top: 1px;
    width: 14px;
    height: 14px;
}

.tree-outline .item .title::after {
    content: "";
}

.tree-outline .item .subtitle::before,
.tree-outline .item .alternate-subtitle::before {
    content: " — ";
}
